home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / drdobbs / 1987 / 06 / bbs.l7 < prev    next >
Text File  |  1987-05-05  |  3KB  |  133 lines

  1. Listing Seven
  2.  
  3. .profile From the Account new
  4.  
  5.  
  6.  
  7.     # set default path to an empty rbin directory
  8.  
  9. 1    PATH=/u/bbs/new/rbin
  10.  
  11.     # set level one prompt to remind users how to log off
  12.  
  13. 2    PS1='Type CNTRL-D now... '
  14.  
  15.     # display the welcome message
  16.  
  17. 3    cat msg1
  18. 4    echo
  19.  
  20.     # make sure the user really wants an account
  21.  
  22. 5    echo "Do you wish to request a login? (Y/N) \c"
  23. 6    read choice
  24.  
  25.     # continue only if the user answers yes
  26.  
  27. 7    if [ "$choice" = y -o "$choice" = Y ]
  28. 8    then
  29. 9        echo
  30. 10        OK="N"
  31.  
  32.     # loop until user is satisfied with data
  33.  
  34. 11        while [ "$OK" != Y -a "$OK" != y ]
  35. 12        do
  36.  
  37.     # collect user name, address, etc.
  38.  
  39. 13            echo "Enter your real name: \c"
  40. 14            read realname
  41. 15            echo
  42. 16            echo "Enter the first line of your mailing address: (4 lines are available)"
  43. 17            read address1
  44. 18            echo
  45. 19            echo "Enter the second line of your mailing address: <cr> if none"
  46. 20            read address2
  47. 21            echo
  48. 22            echo "Enter the third line of your mailing address: <cr> if none"
  49. 23            read address3
  50. 24            echo
  51. 25            echo "Enter the fourth line of your mailing address: <cr> if none"
  52. 26            read address4
  53. 27            echo
  54. 28            echo "Enter your voice telephone number: \c"
  55. 29            read phone
  56. 30            echo
  57.  
  58.     # display the data entered for the user
  59.  
  60. 31            echo "This is what you have entered:"
  61. 32            echo
  62. 33            echo $realname
  63. 34            echo
  64. 35            echo $address1
  65. 36            echo $address2
  66. 37            echo $address3
  67. 38            echo $address4
  68. 39            echo
  69. 40            echo $phone
  70. 41            echo
  71.  
  72.     # ask the user to verify the data
  73.  
  74. 42            echo "Is this correct? (Y/N) \c"
  75. 43            read OK
  76. 44        done
  77. 45        OK="N"
  78.  
  79.     # loop until user is happy
  80.  
  81. 46        while [ "$OK" != Y -a "$OK" != y ]
  82. 47        do
  83.  
  84.     # collect the account data
  85.  
  86. 48            echo
  87. 49            echo "Enter a one word login name: \c"
  88. 50            read lognmae
  89. 51            echo
  90. 52            echo "Enter an initial password: \c"
  91. 53            read initpasswd
  92. 54            echo
  93.  
  94.     # display the entered data for the user
  95.  
  96. 55            echo "You have entered:"
  97. 56            echo
  98. 57            echo $logname
  99. 58            echo $initpasswd
  100. 59            echo
  101.  
  102.     # ask the user to verify the data
  103.  
  104. 60            echo "Is this correct?  (Y/N) \c"
  105. 61            read OK
  106. 62        done
  107. 63        echo
  108.  
  109.     # write the new account data to a holding file
  110.  
  111. 64        echo $realname >>signups
  112. 65        echo $address1 >>signups
  113. 66        echo $address2 >>signups
  114. 67        echo $address3 >>signups
  115. 68        echo $address4 >>signups
  116. 69        echo $phone >>signups
  117. 70        echo $logname >>signups
  118. 71        echo $initpasswd >>signups
  119. 72        echo >>signups
  120.  
  121.     # tell the user that he or she is finished
  122.  
  123. 73        echo "This completes the login request process.  You'll receive an account"
  124. 74        echo "confirmation through the mail within a week."
  125. 75        echo
  126. 76    fi
  127.  
  128.     # tell the user to log off
  129.  
  130. 77    echo
  131. 78    echo "Enter CTNRL-D to log off the system."
  132. 79    echo
  133.